package com.moon.back;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.util.unit.DataSize;

import javax.servlet.MultipartConfigElement;

/**
 * @author 16905
 */
@EnableAspectJAutoProxy
@SpringBootApplication
public class MoonApplication {
    public static void main(String[] args) {
        SpringApplication.run(MoonApplication.class);
    }

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        //允许上传的文件最大值
        factory.setMaxFileSize(DataSize.parse("2048MB"));
        /// 设置总上传数据总大小
        factory.setMaxRequestSize(DataSize.parse("2048MB"));
        return factory.createMultipartConfig();
    }
}